package com.situ.ftbserver.model;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;

@TableName("member")
@Data
public class Member implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotBlank(message = "姓名不可为空")
    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    private String name;

    @NotBlank(message = "手机号不可为空")
    @Pattern(regexp = "^\\d{11}$", message = "手机号必须是11位")
    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    private String phone;

    @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
    private String sex;
    private Integer age;

    private LocalDate birthday;
    private String height;
    private String weight;

    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "邮箱格式错误")
    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    private String email;
}
